Closest pair to the kth index element in tuple in python